<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>Document</title>
    <style>
        .wrap{
            margin: 150px auto;
            width: 150px;
            height: 150px;
            position: relative;
            transform: rotateX(0deg);
            transform-style: preserve-3d;
            perspective: 2500px;

        }
        .wrap>div{
            width: 150px;
            height: 150px;
            position: absolute;
            left: 0;
            top: 0;
            
        }
        .wrap div img{
            width: 300px;
            height: 300px;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div><img src="img/xue1.jpg" alt=""></div>
        <div><img src="img/xue2.jpg" alt=""></div>
        <div><img src="img/xue3.jpg" alt=""></div>
        <div><img src="img/xue4.jpg" alt=""></div>
        <div><img src="img/xue5.jpg" alt=""></div>
        <div><img src="img/xue6.jpg" alt=""></div>
        <!-- <div><img src="" alt=""></div>
        <div><img src="" alt=""></div>
        <div><img src="" alt=""></div>    -->     
    </div>
    <button id="btn">点击旋转</button>
    <script>
        var divNum = document.querySelectorAll('.wrap div');
        var btn = document.getElementById('btn');
        //console.log(divNum);
        for(var i = 0; i < divNum.length; i++){
            divNum[i].style.transform = 'rotateY('+ 360/divNum.length*i +'deg) translateZ(400px)';
        }
        var num = 0;
        btn.onclick = function(){            
            num++;
            for(var i = 0; i < divNum.length; i++){
                divNum[i].style.transition = '1s';
                divNum[i].style.transform = 'rotateY('+ (360/divNum.length*i + 360/divNum.length * num) +'deg) translateZ(400px)';
            }
        }

    </script>

</body>

</html>